package com.leanit.pmc.reg.bean;

import com.leanit.pmc.center.enterprise.EnterPriseInfo;
import com.leanit.pmc.common.util.MD5Encrypt;

/**
 * Created by admin on 2016/3/24.
 */
public class RegVO {
    private String mailKey;
    private String mail;
    private String username;
    private String mobilePhoneNumber;
    private String password;
    private String verifyPassword;
    private String name;
    private String organizationId;
    private String idNo;
    private String address;
    private String contact;
    private String phone;
    private String distinctSign;

    public String getMailKey() {
        return mailKey;
    }

    public void setMailKey(String mailKey) {
        this.mailKey = mailKey;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMobilePhoneNumber() {
        return mobilePhoneNumber;
    }

    public void setMobilePhoneNumber(String mobilePhoneNumber) {
        this.mobilePhoneNumber = mobilePhoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getVerifyPassword() {
        return verifyPassword;
    }

    public void setVerifyPassword(String verifyPassword) {
        this.verifyPassword = verifyPassword;
    }

    public String getDistinctSign() {
        return distinctSign;
    }

    public void setDistinctSign(String distinctSign) {
        this.distinctSign = distinctSign;
    }

    @Override
    public String toString() {
        return "RegVO{" +
                "mailKey='" + mailKey + '\'' +
                ", mail='" + mail + '\'' +
                ", username='" + username + '\'' +
                ", mobilePhoneNumber='" + mobilePhoneNumber + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", organizationId='" + organizationId + '\'' +
                ", idNo='" + idNo + '\'' +
                ", address='" + address + '\'' +
                ", contact='" + contact + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }

    public SysUser getSysUser() {
        SysUser sysUser = new SysUser();
        sysUser.setUsername(username);
        sysUser.setEmail(mail);
        sysUser.setMobilePhoneNumber(phone);
        sysUser.setPassword(MD5Encrypt.getMD5(password));
        sysUser.setStatus("normal");
        sysUser.setDeleted("0");
        sysUser.setAdmin("0");
        sysUser.setCnName(username);
        return sysUser;
    }

    public SysOrganization getSysOrganization() {
        SysOrganization sysOrg = new SysOrganization();
        sysOrg.setName(name);
        sysOrg.setType("company");
        sysOrg.setParentId(1066);
        sysOrg.setParentIds("0/1/1066/");
        sysOrg.setIcon("ztree_leaf");
        sysOrg.setIsShow(1);
        sysOrg.setOrganizationCode(organizationId);
        return sysOrg;
    }

    public EnterPriseInfo getEnterInfo() {
        EnterPriseInfo enterInfo = new EnterPriseInfo();
        enterInfo.setName(name);
        enterInfo.setOrganizationId(organizationId);
        enterInfo.setContact(contact);
        enterInfo.setPhone(phone);
        enterInfo.setAddress(address);
        enterInfo.setMail(mail);
        enterInfo.setIdNo(idNo);
        enterInfo.setDistinctSign(distinctSign);
        return enterInfo;
    }
}
